package common.properties.editors {
import common.properties.PropertyEditor;

import common.properties.PropertyViewer;

import mx.controls.Label;
import mx.controls.TextInput;
import mx.core.UIComponent;

/**
 * Main PropertyViewer. Visual editor is Label
 * supported dataTypes: int, double, string, text
 */
public class TextPropertyViewer implements PropertyViewer {
    private var _viewer:Label = new Label();

    public function TextPropertyViewer() {
    }

    public function get component():UIComponent {
        return _viewer;
    }

    public function set value(val:Object):void {
        if (val == null) {
            _viewer.text = "";
        } else {
            _viewer.text = val.toString();
        }
    }
}
}